/**
 * 
 */
package lv.pig.base.jpa;

import lv.pig.base.shiro.ShiroUtils;

import org.springframework.data.domain.AuditorAware;

/**
 * @author chenbo
 *
 */
public class ShiroAuditorAware implements AuditorAware<Long>
{
    
    @Override
    public Long getCurrentAuditor()
    {
        try
        {
            return ShiroUtils.getUserId();
        }
        catch (Exception e)
        {
            return -1l;
        }
    }
    
}
